<?php
//
//	file: includes/aucp/class_color.php
//	begin: 30/04/2007
//	$Author: christopher $
//	$Revision: 29 $
//	$Date: 2008-07-19 15:59:35 +0000 (Sat, 19 Jul 2008) $
//	license: http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)
//
//	description: loader for color

if (!defined('IN_PHPBB'))
{
	die("Hacking attempt");
}

// definitions
if ( !defined('COLOR_CURRENT_VERSION') )
{
	define('COLOR_CURRENT_VERSION', '2.0.0');
	define('POST_STYLES_URL', 's');
	define('COLOR_TABLE', $table_prefix.'color');

	if ( !empty($config->data['group_session']) )
	{
		define('GROUP_SESSION', $config->data['group_session']);
	}
}

// login or install
if ( defined('IN_LOGIN') )
{
	return;
}

if ( defined('IN_INSTALL') )
{
	include($config->url('includes/aucp/color_handler'));
	$colors = new color_handler();
	return;
}

// check install status
if (!_check_install('mod_aucp_color', COLOR_CURRENT_VERSION))
{
	return;
}

//functions
include($config->url('includes/aucp/color_functions'));

// general
$user->pool_fields[] = 'user_group_id';

// language
if ( defined('IN_ADMIN') || in_array($requester, array('profile', 'usercp', 'groupcp')) )
{
	_add_lang('lang_extend_color', 'colorcp');
}

// handler
include($config->url('includes/aucp/color_handler'));
if (defined('IN_ADMIN') || in_array($requester, array('groupcp', 'admin/admin_groups', 'admin/admin_bots', 'admin/admin_styles')))
{
	$colors = new color_handler_admin();
}
else
{
	$colors = new color_handler();
}
$colors->set_vars();
$colors->read();

// plugs
$config->set_plug_ins('mod_aucp_color', array(
	'caches' => array(
		'layer' => 'includes/aucp/color_plugs',
		'object' => 'color_cache',
	),
	'memberlist' => array(
		'layer' => 'includes/aucp/color_plugs',
		'object' => 'color_members',
	),
	'modcp' => array(
		'layer' => 'includes/aucp/color_plug_modcp',
		'object' => 'color_modcp',
	),
	'page_header' => array(
		'layer' => 'includes/aucp/color_plugs',
		'object' => 'color_header',
	),
	'privmsg' => array(
		'layer' => 'includes/aucp/color_plug_privmsg',
		'object' => 'color_privmsg',
	),
	'profile' => array(
		'layer' => 'includes/aucp/color_plugs',
		'object' => 'color_profile',
	),
	'class_forums' => array(
		'layer' => 'includes/aucp/color_plug_forums',
		'object' => 'color_forums',
	),
	'class_moderators' => array(
		'layer' => 'includes/aucp/color_plugs',
		'object' => 'color_mods',
	),
	'class_posts' => array(
		'layer' => 'includes/aucp/color_plug_posts',
		'object' => 'color_posts',
	),
	'class_stats_online' => array(
		'layer' => 'includes/aucp/color_plugs',
		'object' => 'color_stats',
	),
	'class_topics' => array(
		'layer' => 'includes/aucp/color_plug_topics',
		'object' => 'color_topics',
	),
	'class_versions' => array(
		'layer' => 'includes/aucp/color_plugs',
		'object' => 'color_version',
	),
));

?>